#include "accountprofilerequest.h"
#include "accountprofileresponse.h"

#include <json.h>

#include <QDebug>
#include <QUrl>
#include <QTextStream>
#include <QVariant>

namespace Account {
ProfileRequest::ProfileRequest(const int &userId,const QString &sessionKey, QObject *parent) :
    Network::GetJSONRequest(parent),
    m_userId(userId),
    m_sessionKey(sessionKey),
    m_response(new ProfileResponse())
{
}

Network::JSONResponse &ProfileRequest::jsonResponse()
{
    return *m_response;
}

const Network::JSONResponse &ProfileRequest::jsonResponse() const
{
    return *m_response;
}

QUrl ProfileRequest::url() const
{
    QString url = QString("http://dev.mapi2.me.zing.vn/frs/mapi2/user?method=user.getinfo&uids=%1&session_key=%2&fields=userid,username,tinyurl,firstname,lastname,displayname,gender,email,profile_url,mobile,city,dob,country,address,yahooid,googleid")
            .arg(m_userId).arg(m_sessionKey);
    return QUrl(url);
}
}
